package com.ls.socketio.bean;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @author liShan
 * @date 2019/9/4 14:08
 */
@Getter
@Setter
@ToString
@Entity(name = "room_env")
public class RoomEnvInfo extends BaseInfo {

    @Id
    private Long envId;

    @Column(name = "room_id")
    private Long roomId;

    /**
     * 环境参数类型（0=空气质量；1=氧气含量；2=空气微粒（PM2.5）；3=空气湿度；）
     */
    private short envType;

    /**
     * 0-100（表示百分比）；
     */
    private double envValue;

    public RoomEnvInfo() {
    }

    private RoomEnvInfo(Builder builder) {
        super(builder);
        this.envId = builder.envId;
        this.roomId = builder.roomId;
        this.envType = builder.envType;
        this.envValue = builder.envValue;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder extends BaseBuilder<Builder>{

        private Long envId;
        private Long roomId;
        private short envType;
        private double envValue;

        @Override
        Builder self() {
            return this;
        }

        public Builder roomId(Long roomId){
            this.roomId = roomId;
            return this;
        }

        public Builder envId(Long envId){
            this.envId = envId;
            return this;
        }

        public Builder envType(short envType){
            this.envType = envType;
            return this;
        }

        public Builder envValue(double envValue){
            this.envValue = envValue;
            return this;
        }

        public RoomEnvInfo build() {
            return new RoomEnvInfo(this);
        }


    }


}
